s = input().split(" ")
n = int(s[0])
m = int(s[1])
M = [None] * n
for i in range(n):
    M[i] = [int(x) for x in input().split(" ")]
dp = [0] * m
ans = 0


def largestRectangleArea(heights):
    stack=[(-1,-1)]
    H=heights+[0]
    ans=0
    for i,h in enumerate(H):
        while stack[-1][1]>h:
            _,oh = stack.pop()
            s=(i-stack[-1][0]-1)*oh
            ans=max(ans,s)
        stack.append((i,h))
    return ans


for i in range(n):
    for j in range(m):
        dp[j] = 0 if M[i][j] == 0 else dp[j] + 1
    ans = max(ans,largestRectangleArea(dp))
print(ans)